package com.sjl.util;


/**
 * 封装结果对象，经过springmvc转换成json对象返回给页面
 */

public class Result {

	private Integer code; // 0成功
	private String msg; // 响应失败状态码
	private Object data;
	private Integer count;

	public Result(Integer code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}

	public Result(Integer code, String msg, Object data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public Result(Integer code, String msg, Object data, Integer count) {
		this.code = code;
		this.msg = msg;
		this.data = data;
		this.count = count;
	}

	@Override
	public String toString() {
		return "Result{" +
				"code=" + code +
				", msg='" + msg + '\'' +
				", data=" + data +
				", count=" + count +
				'}';
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}
}
